﻿@page "/typography"
@inherits BasePage
@using MduiBlazor.Shared.Pages.Examples.Typography

<PageTitle>排版</PageTitle>
<div class="mdui-m-y-5">
    <MduiText Typo="@Typo.display1" TextColor="@Colors.Theme.Primary">排版</MduiText>
</div>

<PageContent>
    <PageContentItem Title="字体排版" OnClick="@(_=>ScrollToElementById("typo"))" />
    <PageContentItem Title="内容排版" OnClick="@(_=>ScrollToElementById("contenttypo"))">
        <PageContentItem Title="标题" OnClick="@(_=>ScrollToElementById("title"))" />
        <PageContentItem Title="内联文本样式" OnClick="@(_=>ScrollToElementById("inline"))" />
        <PageContentItem Title="水平分割线" OnClick="@(_=>ScrollToElementById("divider"))" />
        <PageContentItem Title="引用" OnClick="@(_=>ScrollToElementById("blockquote"))" />
        <PageContentItem Title="代码块" OnClick="@(_=>ScrollToElementById("code"))" />
        <PageContentItem Title="无序列表" OnClick="@(_=>ScrollToElementById("ul"))" />
        <PageContentItem Title="有序列表" OnClick="@(_=>ScrollToElementById("ol"))" />
        <PageContentItem Title="文章排版示例" OnClick="@(_=>ScrollToElementById("article"))" />
    </PageContentItem>
</PageContent>

<MduiDivider Class="mdui-m-y-5" />

<div>
    <h2 id="typo">
        <MduiText Typo="@Typo.headline" TextColor="@Colors.Theme.Primary">字体排版</MduiText>
    </h2>

    <p class="mdui-typo">下面是一些基本的排版样式：</p>
    <ExampleSection Component="@typeof(SimpleTypo)" />

    <p class="mdui-typo">在上面的组件设置<code>Opacity</code>参数为<code>true</code>即可使这些样式拥有适当的不透明度：</p>
    <ExampleSection Component="@typeof(OpacityTypo)" />
</div>

<MduiDivider Class="mdui-m-y-5" />

<div>
    <h2 id="contenttypo">
        <MduiText Typo="@Typo.headline" TextColor="@Colors.Theme.Primary">内容排版</MduiText>
    </h2>
    <p class="mdui-typo">
        要使元素拥有排版优化后的样式，需要在这些元素的父组件上设置<code>UseMduiTypo</code>参数为<code>true</code>，或者添加类<code>.mdui-typo</code>。
    </p>

    <MduiText id="title" Typo="@Typo.subheading"><b>标题</b></MduiText>
    <ExampleSection Component="@typeof(TitleTypo)" />

    <p class="mdui-typo">在标题内还可以包含<code>small</code>标签来标记副标题。</p>
    <ExampleSection Component="@typeof(SubtitleTypo)" />

    <MduiText id="inline" Typo="@Typo.subheading"><b>内联文本样式</b></MduiText>
    <ExampleSection Component="@typeof(InlineTypo)" />

    <MduiText id="divider" Typo="@Typo.subheading"><b>水平分割线</b></MduiText>
    <ExampleSection Component="@typeof(DividerTypo)" />

    <MduiText id="blockquote" Typo="@Typo.subheading"><b>引用</b></MduiText>
    <ExampleSection Component="@typeof(BlockquoteTypo)" />

    <MduiText id="code" Typo="@Typo.subheading"><b>代码块</b></MduiText>
    <ExampleSection Component="@typeof(CodeTypo)" />

    <MduiText id="ul" Typo="@Typo.subheading"><b>无序列表</b></MduiText>
    <ExampleSection Component="@typeof(UlTypo)" />

    <MduiText id="ol" Typo="@Typo.subheading"><b>有序列表</b></MduiText>
    <ExampleSection Component="@typeof(OlTypo)" />

    <MduiText id="article" Typo="@Typo.subheading"><b>文章排版示例</b></MduiText>
    <p class="mdui-typo">
        在这些元素的父组件上设置<code>UseMduiTypo</code>参数为<code>true</code>，或者添加类<code>.mdui-typo</code>，就能为整篇文章添加预定的样式。</p>
    <MduiText UseMduiTypo>
        <h3>中文文章排版实例：论语学而篇第一</h3>
        <p>
            <small><b>作者：</b><abbr title="名丘，字仲尼">孔子</abbr>（
                <time>前551年9月28日－前479年4月11日</time>
                ）
            </small>
        </p>
        <h4>本篇引语</h4>
        <p>《学而》是《论语》第一篇的篇名。《论语》中各篇一般都是以第一章的前二三个字作为该篇的篇名。《学而》一篇包括16章，内容涉及诸多方面。其中重点是「吾日三省吾身」；「节用而爱人，使民以时」；「礼之用，和为贵」以及仁、孝、信等道德范畴。
        </p>
        <h4>原文</h4>
        <p>子曰：「学而时习之，不亦说乎？有朋自远方来，不亦乐乎？人不知，而不愠，不亦君子乎？」 </p>
        <h4>译文</h4>
        <p>孔子说：「学了又时常温习和练习，不是很愉快吗？有志同道合的人从远方来，不是很令人高兴的吗？人家不了解我，我也不怨恨、恼怒，不也是一个有德的君子吗？」 </p>
        <h4>评析</h4>
        <p>宋代著名学者<u>朱熹</u>对此章评价极高，说它是「入道之门，积德之基」。本章这三句话是人们非常熟悉的。历来的解释都是：学了以后，又时常温习和练习，不也高兴吗等等。三句话，一句一个意思，前后句子也没有什么连贯性。但也有人认为这样解释不符合原义，指出这里的「学」不是指学习，而是指学说或主张；「时」不能解为时常，而是时代或社会的意思，「习」不是温习，而是使用，引申为采用。而且，这三句话不是孤立的，而是前后相互连贯的。这三句的意思是：自己的学说，要是被社会采用了，那就太高兴了；退一步说，要是没有被社会所采用，可是很多朋友赞同<abbr
                title="张燕婴">我</abbr>的学说，纷纷到我这里来讨论问题，我也感到快乐；再退一步说，即使社会不采用，人们也不理解我，我也不怨恨，这样做，不也就是君子吗？（见《齐鲁学刊》1986年第6期文）这种解释可以自圆其说，而且也有一定的道理，供读者在理解本章内容时参考。
        </p>
        <p>此外，在对「人不知，而不愠」一句的解释中，也有人认为，「人不知」的后面没有宾语，人家不知道什么呢？当时因为孔子有说话的特定环境，他不需要说出知道什么，别人就可以理解了，却给后人留下一个谜。有人说，这一句是接上一句说的，从远方来的朋友向我求教，我告诉他，他还不懂，我却不怨恨。这样，「人不知」就是「人家不知道我所讲述的」了。这样的解释似乎有些牵强。
        </p>
        <p>总之，本章提出以学习为乐事，做到人不知而不愠，反映出孔子学而不厌、诲人不倦、注重修养、严格要求自己的主张。这些思想主张在《论语》书中多处可见，有助于对第一章内容的深入了解。</p>
    </MduiText>
    <div class="mdui-typo">
        <h3>英文文章排版实例</h3>
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
            industry's
            standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to
            make a
            type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
            remaining
            essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem
            Ipsum
            passages, and more recently with desktop publishing software like Aldus PageMaker including versions of
            Lorem
            Ipsum.</p>
        <blockquote>
            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
            dolore magna
            aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
            consequat.
        </blockquote>
        <h4>The standard Lorem Ipsum passage, used since the 1500s</h4>
        <p>"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
            dolore magna
            aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
            consequat.
            Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
            Excepteur sint
            occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>

        <h4>Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC</h4>
        <p>"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem
            aperiam,
            eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim
            ipsam
            voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui
            ratione
            voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,
            adipisci
            velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat
            voluptatem. Ut enim
            ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea
            commodi
            consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae
            consequatur,
            vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"</p>
        <h4>List style in action</h4>
        <ul>
            <li>If you wish to succeed, you should use persistence as your good friend, experience as your reference,
                prudence as
                your brother and hope as your sentry.
                <p>如果你希望成功，当以恒心为良友，以经验为参谋，以谨慎为兄弟，以希望为哨兵。</p>
            </li>
            <li>Sometimes one pays most for the things one gets for nothing.
                <p>有时候一个人为不花钱得到的东西付出的代价最高。</p>
            </li>
            <li>Only those who have the patience to do simple things perfectly ever acquire the skill to do difficult
                things
                easily.
                <p>只有有耐心圆满完成简单工作的人，才能够轻而易举的完成困难的事。</p>
            </li>
        </ul>
        <h4>You may want to create a perfect <code>&lt;hr /&gt;</code> line, despite the fact that there will never have
            one
        </h4>
        <hr>
        <p><abbr title="法国作家罗切福考尔德">La Racheforcauld</abbr> said:
            <mark>"Few things are impossible in themselves; and it is often for want of will, rather than of means, that
                man fails
                to succeed".
            </mark>
            You just need to follow the browser's behavior, and set a right <code>margin</code> to it。it will works nice
            as the
            demo you're watching now. The following code is the best way to render typo in Chinese:
        </p>
    </div>
</div>